# -*- coding: utf-8 -*-
"""
Created on Thu Feb 05 14:36:04 2015

"""

from ib.ext.Contract import Contract
from Tick import Tick

def makeIBContract(contractTuple):
    contract            = Contract()
    contract.m_symbol   = str  (contractTuple[0])
    contract.m_secType  = str  (contractTuple[1])
    contract.m_exchange = str  (contractTuple[2])
    contract.m_currency = str  (contractTuple[3])
    contract.m_expiry   = str  (contractTuple[4])
    contract.m_strike   = float(contractTuple[5])
    contract.m_right    = str  (contractTuple[6])
    return contract
    
def makeTick(contract, value):
    return Tick(contract.m_symbol, value)
    